package com.mcr.reggie.utils;
/**
 * 基于ThreadLocal封装的工具类
 */

public class BaseContext {
    //用于得到用户id
    private static ThreadLocal<Long> threadLocalUser=new InheritableThreadLocal<>();
    public static void setUserCurrentId(Long id){
        threadLocalUser.set(id);
    }
    public static Long getUser(){
        return threadLocalUser.get();
    }
    //用于得到管理员id
    private static ThreadLocal<Long> threadLocalEmp=new InheritableThreadLocal<>();
    public static void setEmpCurrentId(Long id){
        threadLocalEmp.set(id);
    }
    public static Long getEmp(){
        return threadLocalEmp.get();
    }
}
